Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  Create  an  Active  Directory  Site  Link  

 Content of Create an Active Directory Site Link.vbs
MD5 Hash: 9D4C5F116682DF6D6E32478DD9CF64FC
' Description: Creates an Active Directory site link.


strSite1Name = "Ga-Atl-Sales"
strSite2Name = "Wa-Red-Sales"
strSiteLinkRDN = "cn=[" & strSite1Name & "][" & strSite2Name & "]"
intCost = 100
intReplInterval = 60
strDescription = "[" & strSite1Name & "][" & strSite2Name & "]"

Const ADS_PROPERTY_UPDATE = 2

Set objRootDSE = GetObject("LDAP://RootDSE")
strConfigurationNC = objRootDSE.Get("configurationNamingContext")

strSite1DN = "cn=" & strSite1Name & ",cn=Sites," & strConfigurationNC
strSite2DN = "cn=" & strSite2Name & ",cn=Sites," & strConfigurationNC

Set objInterSiteTransports = GetObject("LDAP://" & _
"cn=IP,cn=Inter-Site Transports,cn=Sites," & strConfigurationNC)

Set objSiteLink = objInterSiteTransports.Create("siteLink", strSiteLinkRDN)
objSiteLink.Put "cost", intCost
objSiteLink.Put "replInterval", intReplInterval
objSiteLink.Put "description", strDescription


objSiteLink.PutEx ADS_PROPERTY_UPDATE, "siteList", _
Array(strSite1DN, strSite2DN)
objSiteLink.SetInfo

   © 2008 - 2013 Boris Toll      :: Scripts available: 6.481 ::      :: scriptbox.toll.at ::      :: powered by www.toll.at ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a